﻿Public Class ClassTextTransform
    Public Titre As String
    Public Operations As ClassColTextOp
  
    Public Sub New()
        Me.Titre = ""
        Me.Operations = New ClassColTextOp
    End Sub

    Public Sub GetFromForm()
        Me.Titre = FormTransform.ComboBox1.Text
        Me.Operations.Clear()
        For Each oItem As ListViewItem In FormTransform.ListView1.Items
            Me.Operations.add(oItem.Tag)
        Next
    End Sub

    Public Sub CopyToForm()
        FormTransform.ComboBox1.Text = Me.Titre
        FormTransform.ListView1.Items.Clear()
        For Each OP As ClassTextOp In Me.Operations
            Dim oItem As ListViewItem = FormTransform.ListView1.Items.Add(OP.Caption, OP.Operation.ToString)
            oItem.Tag = OP
        Next
    End Sub

    Public Function Transformer(ByVal Chaine As String) As String
        For Each OP As ClassTextOp In Me.Operations
            Chaine = OP.Transformer(Chaine)
        Next
        Return Chaine
    End Function
End Class
